package org.lanqiao.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.lanqiao.dao.UserDao;
import org.lanqiao.orm.DbUser;
import org.lanqiao.service.ISelectInfoService;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Component("selectService")
public class SelectUserInfoService implements ISelectInfoService {
	
	@Resource
	private UserDao userDao;

	@Override
	@Transactional(propagation=Propagation.SUPPORTS,readOnly=true,rollbackFor={RuntimeException.class,Exception.class})
	public DbUser selectUserInfo(int userid) {
		return userDao.selectByPrimaryKey(userid);
	}
	
	

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	@Override
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	public List selectAllUserService() {
		// TODO Auto-generated method stub
		return userDao.selectAllUser();
	}

}
